package com.mk.api.open.controller;

import com.alibaba.fastjson.JSON;
import com.mk.api.open.domain.MtOrderInfo;
import com.mk.api.open.domain.MtResult;
import com.mk.api.open.util.MktHttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * 〈接收美团外卖回调信息〉
 *
 * @author renqingqing
 * @create 2020/10/9
 */
@RestController
@RequestMapping("/mt/waimai")
@Slf4j
public class NotifyController {


    /**
     * https://developer.meituan.com/openapi#7.5.1
     * 接收订单数据接口
     * @return
     */
    @PostMapping("/order/create")
    public MtResult orderCreate(@RequestBody MtOrderInfo mtWmOrderInfo) {
        System.out.println("美团外卖|接收订单推送消息 orderInfo="+ JSON.toJSONString(mtWmOrderInfo));
        // 推送信息到http接口
        //MktHttpUtil.post("url",new HashMap<>(),new HashMap<>());
        return MtResult.success();
    }
}
